<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ page import="entities.Ability"%>
<%@ page import="java.util.ArrayList"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Ricerca un utente</title>
<link rel="stylesheet" type="text/css" href="/ProgettoWeb/Style/style.css" />
</head>
<body>
	<script type="text/javascript" src="/ProgettoWeb/js/jquery.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$('#header').load('/ProgettoWeb/Common/header.jsp');
			$('#menu').load('/ProgettoWeb/Common/menu.jsp');
			$('#onFooter').load('/ProgettoWeb/Common/onFooter.jsp');
			$('#footer').load('/ProgettoWeb/Common/footer.jsp');
		});
	</script>
	<div id="header"></div>
	<div id="menu"></div>
	
	<div id="welcome">
	<h2 class="title">Ricerca un utente per abilit&agrave</h2>
<%	ArrayList<Ability> abilities = (ArrayList<Ability>) session.getAttribute("abilities");
 	if (abilities == null || abilities.size()==0) {
		%>
		Non ci sono abilita' inserite nel sistema!
		<%
	} else {
		%>
		<div class="entry">
		<form name="ResearchForAbility" action="/ProgettoWeb/SearchUsers.html?ricerca=abilita" method="POST">
		<table border="0" cellpadding="1" cellspacing="2" width="100%">
			<TBODY>
				<tr>
					<select id ="nameAbility" name="nameAbility">
					<%
					for(Ability ability : abilities) {
					%>	
						<option value = '<% out.print(ability.getId()); %>' ><% out.print(ability.getNome()); %>
					<% 
					}
	}
 	session.removeAttribute("abilities");
					%>
					</select>
				</tr>
				<tr>
					<td align="left" width="0%"></td>
					<td align="left" width="50%"><input type="submit"
						value="cerca"></td>
				</tr>
			</TBODY>
		</table>
	</form>	
			
		</div>
	</div>

	<div id="welcome">
	<h2 class="title">Ricerca un utente per nome</h2>
	<div class="entry">
	<p>Inserisci il nome ed/o il cognome dell'utente:</p>
	<form name="ResearchUsers" action="/ProgettoWeb/SearchUsers.html?ricerca=nome"
		method="POST">
		<table border="0" cellpadding="1" cellspacing="2" width="100%">
			<TBODY>
				<tr>
					<td align="left" width="0%">Inserisci il nome dell'utente:</td>
					<td align="left" width="100%"><INPUT id="name" name="name"
						value=""></td>
				</tr>
				<tr>
					<td align="left" width="0%">Inserisci il cognome dell'utente:</td>
					<td align="left" width="100%"><INPUT id="surname"
						name="surname" value=""></td>
				</tr>
				<tr>
					<td align="left" width="0%"></td>
					<td align="left" width="50%"><input type="submit"
						value="cerca"></td>
				</tr>
			</TBODY>
		</table>
	</form>
	</div>
	</div>
	
	<div id="onFooter"></div>
	<div id="footer"></div>
</body>
</html>